/****************************************************************
 *This file is PXIe_dll_lib.h
 ****************************************************************/

#ifndef _PXIe_DLL_LIB_H_
#define _PXIe_DLL_LIB_H_

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "visa.h"

// BAR空间定义，填充到ViUInt16 space参数中
#define BAR0_SPACE             	0
#define BAR1_SPACE             	1
#define BAR2_SPACE             	2
#define BAR3_SPACE             	3
#define BAR4_SPACE             	4
#define BAR5_SPACE             	5

// 开卡函数
ViStatus _VI_FUNC  PXIe_viOpen (ViSession sesn, ViRsrc name, ViAccessMode mode, ViUInt32 timeout, ViPSession vi);

// 关卡函数
ViStatus _VI_FUNC  PXIe_viClose(ViObject vi);

// 获取设备信息
ViStatus _VI_FUNC  PXIe_viDevmsg (ViSession vi, ViPUInt16 vendor_id, ViPUInt16 pci_device_id, ViPUInt16 pci_slot_id, ViPUInt16 pci_bus_id);

// viIn32 32位读取板卡
ViStatus _VI_FUNC  PXIe_viIn32 (ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt32 val32);

// viIn32 32位写入寄存器
ViStatus _VI_FUNC  PXIe_viOut32 (ViSession vi, ViUInt16 space, ViBusAddress offset, ViUInt32  val32);

// 对同一地址进行32位DMA读取
ViStatus _VI_FUNC  PXIe_viIn32_dma (ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt32 val32, ViUInt32 val32_len);

// 对同一地址进行32位DMA写入
ViStatus _VI_FUNC  PXIe_viOut32_dma (ViSession vi, ViUInt16 space, ViBusAddress offset, ViPUInt32  val32, ViUInt32 val32_len);

#endif
